package com.yswy.domain.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.yswy.domain.common.BasePojo;
import com.yswy.domain.entity.user.User;
import com.yswy.domain.vo.gld.addOrUpate.DomainCertificateAddOrUpdate;
import com.yswy.domain.vo.gld.addOrUpate.SoftnessAddOrUpdate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@Api(tags = "域名证书管理")
@TableName(value = "domain_certificate")
public class DomainCertificate extends BasePojo<DomainCertificate> {
    @ApiModelProperty("域名Id")
    private Long domainId;
    @ApiModelProperty("域名")
    private String domainName;
    @ApiModelProperty("使用范围")
    private String usdRange;
    @ApiModelProperty("证书文件路径")
    private String certificateUrl;
    @ApiModelProperty("证书到期时间")
    private Date expirationTime;

    public DomainCertificate(DomainCertificateAddOrUpdate res, User user){
        this.domainId =res.getDomainId();
        this.domainName =res.getDomainName();
        this.usdRange =res.getUsdRange();
        this.certificateUrl =res.getCertificateUrl();
        this.expirationTime =res.getExpirationTime();
        super.setCreateBy(user.getId().longValue());
    }
    public DomainCertificate(){

    }
}
